<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"ipvb.gitee.io","root":"/","scheme":"Gemini","version":"7.7.1","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":true},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"请输入关键字","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"./public/search.xml"};
  </script>

  <meta property="og:type" content="website">
<meta property="og:title" content="陈里强的个人博客">
<meta property="og:url" content="https://ipvb.gitee.io/index.html">
<meta property="og:site_name" content="陈里强的个人博客">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="CHenLiqiang">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://ipvb.gitee.io/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: true,
    isPost: false
  };
</script>

  <title>陈里强的个人博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">陈里强的个人博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>

</nav>
  <div class="site-search">
    <div class="popup search-popup">
    <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocorrect="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result"></div>

</div>
<div class="search-pop-overlay"></div>

  </div>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
        
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block home" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ipvb.gitee.io/2020/06/11/IOC%E5%AE%B9%E5%99%A8%E4%B8%BB%E8%A6%81%E6%A8%A1%E5%9D%97%E5%92%8C%E6%A0%B8%E5%BF%83%E7%90%86%E5%BF%B5/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="CHenLiqiang">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="陈里强的个人博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          
            <a href="/2020/06/11/IOC%E5%AE%B9%E5%99%A8%E4%B8%BB%E8%A6%81%E6%A8%A1%E5%9D%97%E5%92%8C%E6%A0%B8%E5%BF%83%E7%90%86%E5%BF%B5/" class="post-title-link" itemprop="url">IOC容器主要模块和核心理念</a>
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-06-11 12:26:12 / 修改时间：14:58:13" itemprop="dateCreated datePublished" datetime="2020-06-11T12:26:12+08:00">2020-06-11</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h1 id="IOC容器主要模块和核心理念"><a href="#IOC容器主要模块和核心理念" class="headerlink" title="IOC容器主要模块和核心理念"></a>IOC容器主要模块和核心理念</h1><h2 id="一-spring框架功能整体介绍"><a href="#一-spring框架功能整体介绍" class="headerlink" title="一.spring框架功能整体介绍"></a>一.spring框架功能整体介绍</h2><p><img src="/2020/06/11/IOC%E5%AE%B9%E5%99%A8%E4%B8%BB%E8%A6%81%E6%A8%A1%E5%9D%97%E5%92%8C%E6%A0%B8%E5%BF%83%E7%90%86%E5%BF%B5/image-20200611122548230.png" alt="image-20200611122548230"></p>
<h3 id="1-1-Spring-Core-Container"><a href="#1-1-Spring-Core-Container" class="headerlink" title="1.1    Spring Core Container"></a>1.1    Spring Core Container</h3><blockquote>
<p> ​        <strong>模块作用</strong>: Core 和 Beans 模块是框架的基础部分，提供 IoC （转控制）和依赖注入特性。 这里的基础 概念是 BeanFactory，它提供对 Factory 模式的经典实现来消除对程序’性单例模式的需要，并真 正地允许你从程序逻辑中分离出依赖关系和配置</p>
</blockquote>
<h4 id="1-1-1-Core"><a href="#1-1-1-Core" class="headerlink" title="1.1.1     Core"></a>1.1.1     Core</h4><blockquote>
<p>​        主要包含 Spring 框架基本的核心工具类， Spring 的其他组件都要用到这个包 里的类， Core模块是其他组件的基 本核心。</p>
</blockquote>
<h4 id="1-1-2-Beans"><a href="#1-1-2-Beans" class="headerlink" title="1.1.2     Beans"></a>1.1.2     Beans</h4><blockquote>
<p>​        BeanFacotry的作用</p>
</blockquote>
<blockquote>
<p>​        它包含访问配直文件、创建和管理 bean 以及进行 Inversion of Control I DependencyInjection ( IoC/DI ）操作相关的所有类</p>
</blockquote>
<h4 id="1-1-3-Context"><a href="#1-1-3-Context" class="headerlink" title="1.1.3     Context"></a>1.1.3     Context</h4><blockquote>
<p>​        处理BeanFactory，还是ApplicationContext的作用</p>
</blockquote>
<blockquote>
<p>​        模构建于 Core 和 Beans 模块基础之上，提供了一种类似JNDI 注册器的框 架式的对象访问方法。Context 模块继承了 Beans 的特性，为 Spring 核心提供了大量 扩展，添加了对国际化（例如资源绑定）、事件传播、资源加载和对 Context 的透明创 建的支持。 Context 模块同时也支持 J2EE 的一些特性，  ApplicationContext 接口是 Context 模块的关键本质区别:(使用BeanFacotry的bean是延时加载的,ApplicationContext是非延时加载的)</p>
</blockquote>
<h4 id="1-1-4-Expression-Language"><a href="#1-1-4-Expression-Language" class="headerlink" title="1.1.4    Expression Language"></a>1.1.4    Expression Language</h4><blockquote>
<p>​        模块提供了强大的表达式语言，用于在运行时查询和操纵对象。 它是 JSP 2.1 规范中定义的 unifed expression language 的扩展。该语言支持设直／获取属 性的值，属性的分配，方法的调用，访问数组上下文（ accessiong the context of arrays ）、 容器和索引器、逻辑和算术运算符、命名变量以及从Spring的 IoC 容器中根据名称检 索对象。 它也支持 list 投影、选择和一般的 list 聚合</p>
</blockquote>
<h3 id="1-2-Spring-Data-Access-Integration"><a href="#1-2-Spring-Data-Access-Integration" class="headerlink" title="1.2    Spring Data Access/Integration"></a>1.2    Spring Data Access/Integration</h3><h4 id="1-2-1-JDBC"><a href="#1-2-1-JDBC" class="headerlink" title="1.2.1    JDBC"></a>1.2.1    JDBC</h4><blockquote>
<p>​        模块提供了一个 JDBC 抽象层，它可以消除冗长的 JDBC 编码和解析数据库厂 商特有的错误代码。这个模块包含了 Spring 对 JDBC 数据访问进行封装的所有类</p>
</blockquote>
<h4 id="1-2-2-ORM"><a href="#1-2-2-ORM" class="headerlink" title="1.2.2     ORM"></a>1.2.2     ORM</h4><blockquote>
<p>​        模块为流行的对象－关系映射 API，如 JPA、 JDO、 Hibernate、 iBatis 等，提供了 一个交互层。 利用 ORM 封装包，可以混合使用所有 Spring 提供的特性进行 O/R 映射， 如前边提到的简单声   明性事务管理。</p>
</blockquote>
<h4 id="1-2-3-OXM"><a href="#1-2-3-OXM" class="headerlink" title="1.2.3    OXM"></a>1.2.3    OXM</h4><blockquote>
<p>​         模块提供了一个对 ObjecνXML 映射实现的抽象层,Object/XML 映射实现包括 JAXB、 Castor、 XMLBeans、 JiBX 和 XStrearn</p>
</blockquote>
<h4 id="1-2-4-JMS-Java-Messaging-Service-）"><a href="#1-2-4-JMS-Java-Messaging-Service-）" class="headerlink" title="1.2.4    JMS ( Java Messaging Service ）"></a>1.2.4    JMS ( Java Messaging Service ）</h4><blockquote>
<p> ​        模块主要包含了 一些制造和消 费消息的特性。</p>
</blockquote>
<h4 id="1-2-5-Transaction"><a href="#1-2-5-Transaction" class="headerlink" title="1.2.5    Transaction"></a>1.2.5    Transaction</h4><blockquote>
<p>​        支持编程和声明性的事务管理，这些事务类必须实现特定的接口，并 且对所有的 POJO 都适用</p>
</blockquote>
<h3 id="1-3-Spring-Web"><a href="#1-3-Spring-Web" class="headerlink" title="1.3    Spring Web"></a>1.3    Spring Web</h3><blockquote>
<p>  ​        Web 模块：提供了基础的面向 Web 的集成特性c 例如，多文件上传、使用 servlet listeners 初始化，IoC 容器以及一个面向 Web 的应用上下文。 它还包含 Spring 远程支持中 Web 的相关部分。</p>
</blockquote>
<h3 id="1-4-Spring-Aop"><a href="#1-4-Spring-Aop" class="headerlink" title="1.4    Spring Aop"></a>1.4    Spring Aop</h3><h4 id="1-4-1-Aspects"><a href="#1-4-1-Aspects" class="headerlink" title="1.4.1    Aspects"></a>1.4.1    Aspects</h4><blockquote>
<p>​        模块提供了对 AspectJ 的集成支持。</p>
</blockquote>
<h4 id="1-4-2-Instrumentation"><a href="#1-4-2-Instrumentation" class="headerlink" title="1.4.2    Instrumentation"></a>1.4.2    Instrumentation</h4><blockquote>
<p>​        提供了 class instrumentation 支持和 classloader 实现，使得可以在特定的应用服务器上使用</p>
</blockquote>
<h3 id="1-5-Test"><a href="#1-5-Test" class="headerlink" title="1.5    Test"></a>1.5    Test</h3><blockquote>
<p>​        Test 模块支持使用 JUnit 和 TestNG 对 Spring 组件进行测试</p>
</blockquote>
<h3 id="1-6-Spring容器继承图"><a href="#1-6-Spring容器继承图" class="headerlink" title="1.6 Spring容器继承图"></a>1.6 Spring容器继承图</h3><p><img src="/2020/06/11/IOC%E5%AE%B9%E5%99%A8%E4%B8%BB%E8%A6%81%E6%A8%A1%E5%9D%97%E5%92%8C%E6%A0%B8%E5%BF%83%E7%90%86%E5%BF%B5/image-20200611125025085.png" alt="image-20200611125025085"></p>
<h3 id="1-7控制反转和依赖注入"><a href="#1-7控制反转和依赖注入" class="headerlink" title="1.7控制反转和依赖注入"></a>1.7控制反转和依赖注入</h3><h4 id="1-7-1-什么是控制反转"><a href="#1-7-1-什么是控制反转" class="headerlink" title="1.7.1 什么是控制反转?"></a>1.7.1 什么是控制反转?</h4><blockquote>
<p> 我觉得有必要先了解件设计的一个重要思想：<strong>依赖倒置原则（Dependency InversionPrinciple ）</strong>,什么依赖倒置原则? 假设我们设计一辆汽车：先设计轮子，然后根据轮子大小设计底盘，接着根据底盘设计车身，最后根据车身设计好整个汽车。这里就出现了一个“依赖”关系：汽车依赖车身，车身依赖底盘，底盘依赖轮子</p>
</blockquote>
<p><img src="/2020/06/11/IOC%E5%AE%B9%E5%99%A8%E4%B8%BB%E8%A6%81%E6%A8%A1%E5%9D%97%E5%92%8C%E6%A0%B8%E5%BF%83%E7%90%86%E5%BF%B5/image-20200611125302744.png" alt="image-20200611125302744"></p>
<blockquote>
<p>上图看上去没有什么毛病?但是 万一轮胎尺寸改了,那么地盘需要改，地盘改了，车身也改了，让后整个汽车构造都改了.然后汽车公司倒闭了………………….董事长依赖总经理争取，总经理依赖部门经理挣钱，部门经理依赖员工争取，那么员工离职了怎么办</p>
<p>？？？？？？？？？？？？？？？？？？？？？</p>
<p>反过来………………………..假如汽车公司决定修改轮胎的 我们就只需要改动轮子的设计，而不需要动底盘，车身，汽车<br>的设计了。</p>
</blockquote>
<p><img src="/2020/06/11/IOC%E5%AE%B9%E5%99%A8%E4%B8%BB%E8%A6%81%E6%A8%A1%E5%9D%97%E5%92%8C%E6%A0%B8%E5%BF%83%E7%90%86%E5%BF%B5/image-20200611125452143.png" alt="image-20200611125452143"></p>
<h4 id="1-7-2IOC容器的最最最最核心思想"><a href="#1-7-2IOC容器的最最最最核心思想" class="headerlink" title="1.7.2IOC容器的最最最最核心思想"></a>1.7.2IOC容器的最最最最核心思想</h4><p>​        <strong>ioc的思想最核心的地方在于，资源不由使用资源的双方管理，而由不使用资源的第三方管理，这可以带来很多好处。第<br>一，资源集中管理，实现资源的可配置和易管理。第二，降低了使用资源双方的依赖程度，也就是我们说的耦合度</strong></p>
<p><img src="/2020/06/11/IOC%E5%AE%B9%E5%99%A8%E4%B8%BB%E8%A6%81%E6%A8%A1%E5%9D%97%E5%92%8C%E6%A0%B8%E5%BF%83%E7%90%86%E5%BF%B5/image-20200611125629979.png" alt="image-20200611125629979"></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

        
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block home" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ipvb.gitee.io/2020/06/09/%E6%88%91%E7%9A%84%E7%AC%AC%E4%B8%80%E7%AF%87%E5%8D%9A%E5%AE%A2%E6%96%87%E7%AB%A0/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="CHenLiqiang">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="陈里强的个人博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          
            <a href="/2020/06/09/%E6%88%91%E7%9A%84%E7%AC%AC%E4%B8%80%E7%AF%87%E5%8D%9A%E5%AE%A2%E6%96%87%E7%AB%A0/" class="post-title-link" itemprop="url">我的第一篇博客文章</a>
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-06-09 12:02:44" itemprop="dateCreated datePublished" datetime="2020-06-09T12:02:44+08:00">2020-06-09</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-06-11 12:34:52" itemprop="dateModified" datetime="2020-06-11T12:34:52+08:00">2020-06-11</time>
              </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

  </div>

  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">CHenLiqiang</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">2</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">CHenLiqiang</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v4.2.1
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.7.1
  </div>
<span id="busuanzi_container_site_uv">
  本站访问次数：<span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
</span>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  
  <script color='0,0,255' opacity='0.5' zIndex='-1' count='99' src="/lib/canvas-nest/canvas-nest.min.js"></script>
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  

</body>
</html>
